Create configuration

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "hgnested=" >> $HGRCPATH

init repositories

  $ hg init toplevel
  $ echo "f" > toplevel/f
  $ mkdir -p toplevel/d/d
  $ echo "d/d/f" > toplevel/d/d/f
  $ hg init toplevel/d/d/r
  $ echo "d/d/r/f" > toplevel/d/d/r/f
  $ hg init toplevel/r
  $ echo "r/f" > toplevel/r/f
  $ hg init toplevel/r/r
  $ echo "r/r/f" > toplevel/r/r/f
  $ hg init toplevel2
  $ echo "f" > toplevel2/f
  $ ln -s ${PWD}/toplevel2 toplevel/r2
  $ echo "syntax: glob" >>toplevel/.hgignore
  $ echo "r2" >>toplevel/.hgignore

  $ hg commit --cwd toplevel -A -m "init"
  adding .hgignore
  adding d/d/f
  adding f
  $ hg commit --cwd toplevel/d/d/r -A -m "init"
  adding f
  $ hg commit --cwd toplevel/r -A -m "init"
  adding f
  $ hg commit --cwd toplevel/r/r -A -m "init"
  adding f
  $ hg commit --cwd toplevel2 -A -m "init"
  adding f

nclone

  $ hg nclone toplevel toplevel-clone
  [toplevel-clone]
  updating to branch default
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-clone/d/d/r]
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-clone/r]
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-clone/r/r]
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-clone/r2]
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  

nshare

  $ hg nshare toplevel toplevel-share
  [toplevel-share]
  updating working directory
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-share/d/d/r]
  updating working directory
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-share/r]
  updating working directory
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-share/r/r]
  updating working directory
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-share/r2]
  updating working directory
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  

nincoming

  $ hg nincoming --cwd toplevel-clone
  [.]
  comparing with $TESTTMP/toplevel
  searching for changes
  no changes found
  
  [d/d/r]
  comparing with $TESTTMP/toplevel/d/d/r
  searching for changes
  no changes found
  
  [r]
  comparing with $TESTTMP/toplevel/r
  searching for changes
  no changes found
  
  [r/r]
  comparing with $TESTTMP/toplevel/r/r
  searching for changes
  no changes found
  
  [r2]
  comparing with $TESTTMP/toplevel/r2
  searching for changes
  no changes found
  
add repository without paths section

  $ hg init toplevel-clone/sub-without-paths

npull

  $ hg npull --cwd toplevel-clone 2>&1 | sed -e "s,$HGTMP/child0,\$HGTMP/,"
  [.]
  pulling from $HGTMP//test-hgnested.t/toplevel
  searching for changes
  no changes found
  
  [d/d/r]
  pulling from $HGTMP//test-hgnested.t/toplevel/d/d/r
  searching for changes
  no changes found
  
  [r]
  pulling from $HGTMP//test-hgnested.t/toplevel/r
  searching for changes
  no changes found
  
  [r/r]
  pulling from $HGTMP//test-hgnested.t/toplevel/r/r
  searching for changes
  no changes found
  
  [r2]
  pulling from $HGTMP//test-hgnested.t/toplevel/r2
  searching for changes
  no changes found
  
  [sub-without-paths]
  abort: repository default not found!
  $ echo "r/r/f2" > toplevel/r/r/f2
  $ hg commit --cwd toplevel/r/r -A -m "add f2"
  adding f2
  $ hg npull --cwd toplevel-clone 2>&1 | sed -e "s,$HGTMP/child0,\$HGTMP/,"
  [.]
  pulling from $HGTMP//test-hgnested.t/toplevel
  searching for changes
  no changes found
  
  [d/d/r]
  pulling from $HGTMP//test-hgnested.t/toplevel/d/d/r
  searching for changes
  no changes found
  
  [r]
  pulling from $HGTMP//test-hgnested.t/toplevel/r
  searching for changes
  no changes found
  
  [r/r]
  pulling from $HGTMP//test-hgnested.t/toplevel/r/r
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  (run 'hg update' to get a working copy)
  
  [r2]
  pulling from $HGTMP//test-hgnested.t/toplevel/r2
  searching for changes
  no changes found
  
  [sub-without-paths]
  abort: repository default not found!

delete repository without paths section

  $ rm -r toplevel-clone/sub-without-paths

nupdate

  $ hg nupdate --cwd toplevel-clone
  [.]
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [d/d/r]
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [r]
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [r/r]
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [r2]
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  

Test 'quiet' parameter

  $ hg -q nupdate --cwd toplevel-clone

nstatus

  $ hg nstatus --cwd toplevel
  [.]
  
  [d/d/r]
  
  [r]
  
  [r/r]
  
  [r2]
  
  $ echo "f2" > toplevel/f2
  $ echo "f2" > toplevel/r/f2
  $ hg add --cwd toplevel/r f2
  $ rm toplevel/r/r/f2
  $ hg nstatus --cwd toplevel
  [.]
  ? f2
  
  [d/d/r]
  
  [r]
  A f2
  
  [r/r]
  ! f2
  
  [r2]
  

ndiff

  $ hg ndiff --cwd toplevel --nodates
  diff -r 032a2c66592c r/f2
  --- /dev/null
  +++ b/r/f2
  @@ -0,0 +1,1 @@
  +f2

noutgoing

  $ echo "f3" > toplevel-clone/f3
  $ echo "f3" > toplevel-clone/r/r/f3
  $ echo "f3" > toplevel-clone/d/d/r/f3
  $ hg commit --cwd toplevel-clone -A -m "add f3"
  adding f3
  $ hg commit --cwd toplevel-clone/r/r -A -m "add f3"
  adding f3
  $ hg commit --cwd toplevel-clone/d/d/r -A -m "add f3"
  adding f3
  $ hg noutgoing --cwd toplevel-clone
  [.]
  comparing with $TESTTMP/toplevel
  searching for changes
  changeset:   1:2e794a5d357a
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     add f3
  
  
  [d/d/r]
  comparing with $TESTTMP/toplevel/d/d/r
  searching for changes
  changeset:   1:0dfff144d3ec
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     add f3
  
  
  [r]
  comparing with $TESTTMP/toplevel/r
  searching for changes
  no changes found
  
  [r/r]
  comparing with $TESTTMP/toplevel/r/r
  searching for changes
  changeset:   2:f0c515605a0a
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     add f3
  
  
  [r2]
  comparing with $TESTTMP/toplevel/r2
  searching for changes
  no changes found
  

npush

  $ hg npush --cwd toplevel-clone | sed -e "s,$HGTMP/child0,\$HGTMP/,"
  [.]
  pushing to $HGTMP//test-hgnested.t/toplevel
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  
  [d/d/r]
  pushing to $HGTMP//test-hgnested.t/toplevel/d/d/r
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  
  [r]
  pushing to $HGTMP//test-hgnested.t/toplevel/r
  searching for changes
  no changes found
  
  [r/r]
  pushing to $HGTMP//test-hgnested.t/toplevel/r/r
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  
  [r2]
  pushing to $HGTMP//test-hgnested.t/toplevel/r2
  searching for changes
  no changes found
  

nclone ssh

  $ hg nclone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/toplevel toplevel-sshclone
  [toplevel-sshclone]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 4 changes to 4 files
  updating to branch default
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-sshclone/d/d/r]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 2 changes to 2 files
  updating to branch default
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-sshclone/r]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-sshclone/r/r]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 3 changes to 3 files
  updating to branch default
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-sshclone/r2]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  

noutgoing ssh

  $ echo "f4" > toplevel-sshclone/f4
  $ echo "f4" > toplevel-sshclone/r/r/f4
  $ echo "f4" > toplevel-sshclone/d/d/r/f4
  $ hg commit --cwd toplevel-sshclone -A -m "add f4"
  adding f4
  $ hg commit --cwd toplevel-sshclone/r/r -A -m "add f4"
  adding f4
  $ hg commit --cwd toplevel-sshclone/d/d/r -A -m "add f4"
  adding f4
  $ hg noutgoing -e "python \"$TESTDIR/dummyssh\"" --cwd toplevel-sshclone
  [.]
  comparing with ssh://user@dummy/toplevel/
  searching for changes
  changeset:   2:b1a225fbdea3
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     add f4
  
  
  [d/d/r]
  comparing with ssh://user@dummy/toplevel/d/d/r
  searching for changes
  changeset:   2:3a4724070826
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     add f4
  
  
  [r]
  comparing with ssh://user@dummy/toplevel/r
  searching for changes
  no changes found
  
  [r/r]
  comparing with ssh://user@dummy/toplevel/r/r
  searching for changes
  changeset:   3:dd6f7ad43bb5
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     add f4
  
  
  [r2]
  comparing with ssh://user@dummy/toplevel/r2
  searching for changes
  no changes found
  

npush ssh

  $ hg npush -e "python \"$TESTDIR/dummyssh\"" --cwd toplevel-sshclone | sed -e "s,$HGTMP/child0,\$HGTMP/,"
  [.]
  pushing to ssh://user@dummy/toplevel/
  searching for changes
  remote: adding changesets
  remote: adding manifests
  remote: adding file changes
  remote: added 1 changesets with 1 changes to 1 files
  
  [d/d/r]
  pushing to ssh://user@dummy/toplevel/d/d/r
  searching for changes
  remote: adding changesets
  remote: adding manifests
  remote: adding file changes
  remote: added 1 changesets with 1 changes to 1 files
  
  [r]
  pushing to ssh://user@dummy/toplevel/r
  searching for changes
  no changes found
  
  [r/r]
  pushing to ssh://user@dummy/toplevel/r/r
  searching for changes
  remote: adding changesets
  remote: adding manifests
  remote: adding file changes
  remote: added 1 changesets with 1 changes to 1 files
  
  [r2]
  pushing to ssh://user@dummy/toplevel/r2
  searching for changes
  no changes found
  

nclone http

  $ echo "[collections]" >> toplevel.conf
  $ echo "${PWD} = ${PWD}" >> toplevel.conf
  $ hg serve -p $HGPORT -d --pid-file=hg1.pid --webdir-conf toplevel.conf
  $ cat hg1.pid >> $DAEMON_PIDS
  $ hg nclone http://localhost:$HGPORT/toplevel toplevel-httpclone 2>&1 | sed -e "s,:$HGPORT/child0,:\$HGPORT/,"
  [toplevel-httpclone]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 5 changes to 5 files
  updating to branch default
  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-httpclone/d/d/r]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 3 changes to 3 files
  updating to branch default
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-httpclone/r]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-httpclone/r/r]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 4 changesets with 4 changes to 4 files
  updating to branch default
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  [toplevel-httpclone/r2]
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
